﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Frota.aspx.cs" Inherits="TrocaOleo.Viewer.Frota" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
            
        }
        .style2
        {
            width: 114px;
        }
        .style3
        {
            width: 153px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p>

        &nbsp;<br />
        Cadastro de frota</p>
    <table class="style1">
        <tr>
            <td class="style2">
                Placa:</td>
            <td class="style3">
                <asp:TextBox ID="txtplaca" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="btnPesq" runat="server" Text="Pesquisa" />
            </td>
        </tr>
        <tr>
            <td class="style2">
                Modelo:</td>
            <td colspan="2">
                <asp:TextBox ID="txtmodelo" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Dt.Aquisicao:</td>
            <td colspan="2">
                <asp:TextBox ID="txtaquisicao" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Km:</td>
            <td colspan="2">
                <asp:TextBox ID="txtkm" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Dt. Atu. Km:</td>
            <td colspan="2">
                <asp:TextBox ID="txtatukm" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Km Troca Oleo:</td>
            <td colspan="2">
                <asp:TextBox ID="txtkmoleo" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Dt. Troca Oleo:</td>
            <td colspan="2">
                <asp:TextBox ID="txtdttrocaoleo" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style2">
                Id. Motorista:</td>
            <td>
                <asp:TextBox ID="txtidmotorista" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="btnGravar" runat="server" Text="Gravar" 
                    onclick="btnGravar_Click" />
            </td>
        </tr>
    </table>
    <p>
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" 
            DataSourceID="ObjectDataSource1" EnableModelValidation="True" 
            ForeColor="#333333" GridLines="None" DataKeyNames="Placa">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"  />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            DeleteMethod="DeletarFrota" SelectMethod="ListarFrota" 
            TypeName="TrocaOleo.Controller.WsTrocaOleo" 
            OldValuesParameterFormatString="original_{0}" UpdateMethod="UpdateFrota" 
            >
            <DeleteParameters>
                <asp:Parameter Name="Placa" Type="String" />
            </DeleteParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="txtplaca" DefaultValue="%" Name="Placa" 
                    PropertyName="Text" Type="String" />
            </SelectParameters>            
            <UpdateParameters>
                <asp:Parameter Name="placa" Type="String" />
                <asp:Parameter Name="modelo" Type="String" />
                <asp:Parameter Name="data_aquisicao" Type="String" />
                <asp:Parameter Name="km" Type="Double" />
                <asp:Parameter Name="data_atualizacao_km" Type="String" />
                <asp:Parameter Name="km_troca_oleo" Type="Double" />
                <asp:Parameter Name="data_km_troca_oleo" Type="String" />
                <asp:Parameter Name="motorista" Type="Int32" />
            </UpdateParameters>
        </asp:ObjectDataSource>
    </p>
    <p>
        &nbsp;</p>

</asp:Content>
